<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Http\Request;
use Spatie\Activitylog\Models\Activity;
use App\Http\Resources\LogResource;

class LogController extends Controller
{
    /**
     * 用户列表
     * @param Request $request
     * @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
     */
    public function index(Request $request)
    {
        $logs = Activity::inLog('login')->latest()->with('causer')->paginate($request->get('per_page', 10));
        return LogResource::collection($logs);
    }
}
